import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/home/Home.vue";
import Article from "../views/article/Article.vue";
import Archive from "../views/archive/Archive.vue";
import Category from "../views/category/Category.vue";
import Tag from "../views/tag/Tag.vue";
import Link from "../views/link/Link.vue";
import About from "../views/about/About.vue";
import Music from "../views/music/Music.vue";
import Comment from "../views/comment/Comment.vue";
import ArticleList from "../components/ArticleList.vue";
import TagList from "../components/TagList.vue";


Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    component: Home,
  },
  {
    path: "/articles/list/:id",
    component: Article,
    props: true,
  },
  {
    path: "/archives",
    component: Archive
  },
  {
    path: "/categories",
    component: Category
  },
  {
    path: "/categories/:id",
    component: ArticleList,
    props: true,
  },
  {
    path: "/tags",
    component: Tag
  },
  {
    path: "/tags/:id",
    component: TagList,
    props: true,
  },
  {
    path: "/links",
    component: Link
  },
  {
    path: "/about",
    component: About
  },
  {
    path: "/comment",
    component: Comment
  },
  {
    path: "/music",
    component: Music
  },
];

const router = new VueRouter({
  mode: "hash",
  base: process.env.BASE_URL,
  routes
});

export default router;
